import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import store from '../store/index.js'
Vue.use(VueRouter)

const routes = [{
		path: '/',
		name: 'Home',
		component: Home
	},
	{
		path: '/about',
		name: 'About',
		component: () => import('../views/About.vue')
	},
	{
		path: '/list',
		name: 'List',
		component: () => import('../views/List.vue')
	},
	{
		path: '/my',
		name: 'My',
		component: () => import('../views/My.vue')
	},
	{
		path: '/login',
		name: 'Login',
		component: () => import('../views/Login.vue')
	},
	{
		path: '/setting',
		name: 'Setting',
		component: () => import('../views/Setting.vue')
	},
	{
		path: '/detail',
		name: 'Detail',
		component: () => import('../views/Detail.vue')
	},
	{
		path: '/cellphone',
		name: 'cellphone',
		component: () => import('../views/cellphone.vue')
	},
	{
		path: '/liebiaoym',
		name: 'Liebiaoym',
		component: () => import('../views/Liebiaoym.vue')
	}, {
		path: '/xingpingym',
		name: 'Xingpingym',
		component: () => import('../views/Xingpingym.vue')
	}, {
		path: '/gouwuche',
		name: 'Gouwuche',
		component: () => import('../views/Gouwuche.vue')
	}, {
		path: '/dizhiym',
		name: 'dizhiym',
		component: () => import('../views/dizhiym.vue')
	}, {
		path: '/bianjishdz',
		name: 'Bianjishdz',
		component: () => import('../views/Bianjishdz.vue')
	}, {
		path: '/gerenzl',
		name: 'Gerenzl',
		component: () => import('../views/Gerenzl.vue')
	}, {
		path: '/search',
		name: 'Search',
		component: () => import('../views/Search.vue')
	},
	{
		path: '/searchList',
		name: 'SearchList',
		component: () => import('../views/SearchList.vue')
		}
	,
	{
		path: '/indent',
		name: 'Indent',
		component: () => import('../views/Indent.vue')
	}
]

const router = new VueRouter({
	routes
})
router.beforeEach((to, from, next) => {
	console.log(to);
	store.commit("showRuter", to.path)
	next()
})
export default router
